package com.logistics.system.service.impl;

import java.util.List;
import com.logistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.logistics.system.mapper.PayTradeMapper;
import com.logistics.system.domain.PayTrade;
import com.logistics.system.service.IPayTradeService;

/**
 * 支付订单Service业务层处理
 * 
 * @author logistics
 * @date 2024-06-23
 */
@Service
public class PayTradeServiceImpl implements IPayTradeService 
{
    @Autowired
    private PayTradeMapper payTradeMapper;

    /**
     * 查询支付订单
     * 
     * @param tradeId 支付订单主键
     * @return 支付订单
     */
    @Override
    public PayTrade selectPayTradeByTradeId(Long tradeId)
    {
        return payTradeMapper.selectPayTradeByTradeId(tradeId);
    }

    /**
     * 查询支付订单列表
     * 
     * @param payTrade 支付订单
     * @return 支付订单
     */
    @Override
    public List<PayTrade> selectPayTradeList(PayTrade payTrade)
    {
        return payTradeMapper.selectPayTradeList(payTrade);
    }

    /**
     * 新增支付订单
     * 
     * @param payTrade 支付订单
     * @return 结果
     */
    @Override
    public int insertPayTrade(PayTrade payTrade)
    {
        payTrade.setCreateTime(DateUtils.getNowDate());
        return payTradeMapper.insertPayTrade(payTrade);
    }

    /**
     * 修改支付订单
     * 
     * @param payTrade 支付订单
     * @return 结果
     */
    @Override
    public int updatePayTrade(PayTrade payTrade)
    {
        payTrade.setUpdateTime(DateUtils.getNowDate());
        return payTradeMapper.updatePayTrade(payTrade);
    }

    /**
     * 批量删除支付订单
     * 
     * @param tradeIds 需要删除的支付订单主键
     * @return 结果
     */
    @Override
    public int deletePayTradeByTradeIds(Long[] tradeIds)
    {
        return payTradeMapper.deletePayTradeByTradeIds(tradeIds);
    }

    /**
     * 删除支付订单信息
     * 
     * @param tradeId 支付订单主键
     * @return 结果
     */
    @Override
    public int deletePayTradeByTradeId(Long tradeId)
    {
        return payTradeMapper.deletePayTradeByTradeId(tradeId);
    }
}
